<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>组件配置配置-textarea</title>
<{$showjs}>
<link rel="stylesheet" type="text/css" href="../css/main1.css" />
    <style>
        .x-check-group-alt {
            background: #D1DDEF;
            border-top:1px dotted #B5B8C8;
            border-bottom:1px dotted #B5B8C8;
        }
    </style>
<script language="javascript">
Ext.onReady(function(){
    Ext.QuickTips.init();
    Ext.form.Field.prototype.msgTarget = 'side';
	var myMask = new Ext.LoadMask(Ext.getBody(), {
							msg: '请稍候...',
							removeMask: true //完成后移除
						});
    var fp = new Ext.FormPanel({
        frame: true,
//        title:'权限组设置 [Right Group Config]',
        labelWidth: 110,
        width: Ext.getBody().getWidth(),
        renderTo:'form-ct',
        bodyStyle: 'padding:0 10px 0;',
        
        items: [{
            xtype:'fieldset',
            title: '自身配置',
            autoHeight: true,
            layout: 'form',
            items: [{
                xtype: 'textfield',
                name: 'width',
                fieldLabel: '宽度',
				itemCls: 'x-check-group-alt',
				value:'<{if $fld.width==''}>300<{else}><{$fld.width}><{/if}>',
				width:'80px'
            },{
                xtype: 'textfield',
                name: 'ts',
                fieldLabel: '提示语',
				value:'<{if $fld.ts==''}><{$fld.name}>不能为空!<{else}><{$fld.ts}><{/if}>',
                anchor: '95%'
            },{
               xtype: 'checkboxgroup',
                fieldLabel: '打勾配置',
				itemCls: 'x-check-group-alt',
                items: [
                    {boxLabel: '允许为空', name: 'yxwk',inputValue:1<{if $fld.yxwk=='1'}>,checked: true<{/if}>},
                    {boxLabel: '标题搜索', name: 'bt',inputValue: 1<{if $fld.bt=='1'}>,checked: true<{/if}>},
                    {boxLabel: '高级搜索', name: 'gj',inputValue: 1<{if $fld.gj=='1'}>,checked: true<{/if}>},
                    {boxLabel: '转译打开', name: 'zy',inputValue: 1<{if $fld.zy=='1'}>,checked: true<{/if}>},
                    {boxLabel: '屏蔽显示', name: 'xr',inputValue:1<{if $fld.xr=='1'}>,checked: true<{/if}>}
                ]
            }]
        },{
            xtype:'fieldset',
            title: '虚拟参数设置',
            autoHeight: true,
            items: [{
                itemCls: 'x-check-group-alt',
 				allowBlank: false,
                layout:'form',
                items: [{
               xtype: 'checkboxgroup',
                fieldLabel: '打勾配置',
				itemCls: 'x-check-group-alt',
                items: [
                    {boxLabel: '只读', name: 'cfg[readonly]',inputValue:1<{if $cfg.readonly=='1'}>,checked: true<{/if}>}
                ]
            },{
               	xtype: 'textarea',
                fieldLabel: 'STR[JSON]{,结尾,否则不显示,此处是EXTJS式的JSON配置.}',
				name:'cfg[STR]',
				width:200,
				value:'<{$cfg.STR}>'
	            }]
            }]
        },{
            xtype:'fieldset',
            title: '通用配置',
            autoHeight: true,
            items: [{
                itemCls: 'x-check-group-alt',
 				allowBlank: false,
                layout:'column',
                items: [{
                    columnWidth: '.33',
			        bodyStyle: 'padding:0 10px 0;',
 					labelWidth:60,
					layout:'form',
                   items: [{
							html:"<font color='red'><b>默认值<hr></b></font>"
							},{xtype: 'combo',value:'<{if $fld.qzfs==''}>1<{else}><{$fld.qzfs}><{/if}>',fieldLabel:'取值方式',blankText:'...不能为空',style:'text-align:left',mode: 'local',forceSelection: true,triggerAction: 'all',width: 90,editable: false,emptyText:'请选择...',valueField :'yinv',displayField:'xianv',store:new Ext.data.SimpleStore({fields:['yinv','xianv'],data:[['0','不变值'],['1','正常表单'],['function','function'],['$_GET','$_GET'],['$_POST','$_POST'],['$_SESSION','$_SESSION'],['$_COOKIE','$_COOKIE'],['$_SERVER','$_SERVER'],['$_ENV','$_ENV'],['$_FILES','$_FILES']]}),hiddenName: 'qzfs'},
{
                xtype: 'textfield',
                name: 'blm',
                fieldLabel: '变量名',
				value:"<{$fld.blm}>",
				width:'80px'}]
                },{
                    columnWidth: '.33',
			        bodyStyle: 'padding:0 10px 0;',
 					labelWidth:40,
					layout:'form',
                   items: [{
							html:"<font color='red'><b>XY坐标<hr></b></font>"
							},{
                xtype: 'textfield',
                name: 'x',
                fieldLabel: 'X轴',
				value:'<{$fld.x}>',
				width:'80px'},
{
                xtype: 'textfield',
                name: 'y',
                fieldLabel: 'Y轴',
				value:'<{$fld.y}>',
				width:'80px'}]
                },{
                    columnWidth: '.33',
			        bodyStyle: 'padding:0 10px 0;',
 					labelWidth:40,
					layout:'form',
                   items: [{
							html:"<font color='red'><b>Z坐标<hr></b></font>"
							},{
                xtype: 'textfield',
                name: 'z',
                fieldLabel: 'Z轴',
				value:'<{$fld.z}>',
				width:'80px'},{
                xtype: 'hidden',
                name: 'id',
				value:'<{$fld.id}>'},{
                xtype: 'hidden',
                name: 'type',
				value:'<{$fld.type}>'}]
                }]
            }]
        }],
        
        buttons: [{
            text: '保存',
            handler: function(){
               if(fp.getForm().isValid()){
                    //Ext.Msg.alert('Submitted Values',fp.getForm().getValues(true).replace(/&/g,', '));
					myMask.show();
					fp.form.doAction('submit',{
									url:'fldcfg.php',
									method:'POST',
									params:{op:'save'},
									waitMsg:'正在提交....',
									success:function (response){
									 myMask.hide();
									parent.Ext.getCmp('<{$fld.id}>').close();
									Ext.MessageBox.alert('信息提示','提交成功');
									},
									failure:function (response){
									    Ext.MessageBox.alert('信息提示','提交失败');
									}
								});

                }
            }
        },{
            text: 'Reset',
            handler: function(){
                fp.getForm().reset();
            }
        }]
    });
});
</script>
</head>
<body>
<div id="form-ct"></div>
</body>
</html>
